package com.hzqy.web.vo.yxt;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class EasyuiDatagridVo<T> {
	//in
	private int page;
	private int rows;
	
	
	private int firstResult;
	private int maxResults;

	//out
	private List<T> Vorows;
	private int total;
	
	
	public int getPage() {
		return page;
	}
	public void setPage(int page) {
		this.page = page;
	}
	public int getRows() {
		return rows;
	}
	public void setRows(int rows) {
		this.rows = rows;
	}
	public int getFirstResult() {
		return firstResult;
	}
	public void setFirstResult(int firstResult) {
		this.firstResult = firstResult;
	}
	public int getMaxResults() {
		return maxResults;
	}
	public void setMaxResults(int maxResults) {
		this.maxResults = maxResults;
	}

	public List<T> getVorows() {
		return Vorows;
	}
	public void setVorows(List<T> vorows) {
		Vorows = vorows;
	}
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	
	public void processPage() {
		this.setFirstResult((page - 1) * rows);
		this.setMaxResults(rows);
	}
	
	public Map<String, Object> toEasyuiDatagridData() {
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("total", total);
		map.put("rows", Vorows);
		return map;
	}
	
	
}
